/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sp.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Thosan Girisona S
 */
@Entity
@Table(name = "kecamatan")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Kecamatan.findAll", query = "SELECT k FROM Kecamatan k"),
    @NamedQuery(name = "Kecamatan.findById", query = "SELECT k FROM Kecamatan k WHERE k.id = :id"),
    @NamedQuery(name = "Kecamatan.findByIdkecamatan", query = "SELECT k FROM Kecamatan k WHERE k.idkecamatan = :idkecamatan"),
    @NamedQuery(name = "Kecamatan.findByNamakecamatan", query = "SELECT k FROM Kecamatan k WHERE k.namakecamatan = :namakecamatan"),
    @NamedQuery(name = "Kecamatan.findByNokorwil", query = "SELECT k FROM Kecamatan k WHERE k.nokorwil = :nokorwil"),
    @NamedQuery(name = "Kecamatan.findByKota", query = "SELECT k FROM Kecamatan k WHERE k.kota = :kota")})
public class Kecamatan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "idkecamatan")
    private String idkecamatan;
    @Basic(optional = false)
    @Column(name = "namakecamatan")
    private String namakecamatan;
    @Column(name = "nokorwil")
    private String nokorwil;
    @Basic(optional = false)
    @Column(name = "kota")
    private String kota;

    public Kecamatan() {
    }

    public Kecamatan(Integer id) {
        this.id = id;
    }

    public Kecamatan(Integer id, String idkecamatan, String namakecamatan, String kota) {
        this.id = id;
        this.idkecamatan = idkecamatan;
        this.namakecamatan = namakecamatan;
        this.kota = kota;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getIdkecamatan() {
        return idkecamatan;
    }

    public void setIdkecamatan(String idkecamatan) {
        this.idkecamatan = idkecamatan;
    }

    public String getNamakecamatan() {
        return namakecamatan;
    }

    public void setNamakecamatan(String namakecamatan) {
        this.namakecamatan = namakecamatan;
    }

    public String getNokorwil() {
        return nokorwil;
    }

    public void setNokorwil(String nokorwil) {
        this.nokorwil = nokorwil;
    }

    public String getKota() {
        return kota;
    }

    public void setKota(String kota) {
        this.kota = kota;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Kecamatan)) {
            return false;
        }
        Kecamatan other = (Kecamatan) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sp.model.Kecamatan[ id=" + id + " ]";
    }
    
}
